/*
 * 太原科技大学。
 * Copyright 2021, YCHS Information&Science Technology Co.,Ltd,
 * All rights reserved.
 */
package com.example.demo.service.impl;

import com.example.demo.mapper.PlanMapper;
import com.example.demo.pojo.PageBean;
import com.example.demo.pojo.Plan;
import com.example.demo.service.PlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuchao
 * @version 1.0
 * @date 2024/5/5
 */

@Service
public class PlanServiceImpl implements PlanService {
    @Autowired
    private PlanMapper planMapper;


    @Override
    public PageBean selectUserID(Object username, int id) {

        //封装后端所需要的数据
        PageBean plan= new PageBean();
        plan.setUserid(id);
        plan.setUsername(username);
        plan.setPlan(planMapper.selectUseId(id));
        return plan;
    }

    @Override
    public void deleatId(Integer id) {
        planMapper.deleteId(id);
    }

    @Override
    public Plan addPlan(Plan plan) {

        planMapper.selectthis(plan);//这个方法直接将其planid封装在了plan中

        return plan;
    }
}
